#include "mainwindow.h"
#include "log_in.h"
#include <QApplication>
#include <QtSql>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QSqlDatabase db=QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName("localhost");
    db.setUserName("root");
    db.setPassword("fc123");
    db.setDatabaseName("course_selected");   //链接数据库
    if(db.open()==true)
         qDebug()<<"connect success";
    else
         qDebug()<<"connect error";

    log_in first; //登录界面
    first.show();

    return a.exec();
}

